export const getKeyValue = (obj: any) => {
  const proxy = new Proxy(obj, {
    get(target, property) {
      if (property in target) {
        return target[property]
      }
      const properties = property.split('.')
      let value = target
      for (let prop of properties) {
        if (prop in value) {
          value = value[prop]
        } else {
          return undefined
        }
      }
      return value
    },
  })
  return proxy
}
